package com.bowen.demo.demo003.request;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang.StringUtils;

/**
 * 日志类型枚举
 * 公众号【猿码天地】
 */
@Getter
public enum FrontEndLogName {

	DynErpExpBaseService("11" ,"DynErpExpBaseService"),
	/**
	 * 银行号信息表
	 */
	ErpExpBankBranchesService("10" ,"ErpExpBankBranchesService"),
	/**
	 * 银行账户信息表
	 */
	ErpExpOuterBankAccountInfoService("9" ,"ErpExpOuterBankAccountInfoService"),
	/**
	 * 支付结算记录表
	 */
	ErpExpPaymentInfoService("8" ,"ErpExpPaymentInfoService"),
	/**
	 * 当天导出账户余额
	 */
	ExportBalanceService("7" ,"ExportBalanceService"),
	/**
	 * 导出联行号
	 */
	ExportBRDService("6" ,"ExportBRDService"),
	/**
	 * 当天导出账户当日明细
	 */
	ExportTodayService("5" ,"ExportTodayService"),
	/**
	 * 当天导出历史交易
	 */
	ExportTransService("4" ,"ExportTransService"),

	ImportHisTransService("3" ,"ImportHisTransService"),
	/**
	 * 委托支付
	 */
	PaymentService("1" ,"PaymentService"),
	/**
	 * 代发代扣明细
	 */
	PayService("2" ,"PayService");

	@Setter
	private String code;
	@Setter
	private String name;

	FrontEndLogName(String code, String name) {
		this.code = code;
		this.name = name;
	}

	/**
	 * 通过code获取
	 * @param code
	 * @return
	 */
	public static FrontEndLogName getByCode(String code) {
		FrontEndLogName result = null;
		FrontEndLogName[] vals = FrontEndLogName.values();
		for (FrontEndLogName payMentStatus : vals) {
			String _code = payMentStatus.getCode();
			if(StringUtils.equalsIgnoreCase(code, _code)) {
				result = payMentStatus;
				break;
			}
		}
		return result;
	}

}
